<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <link rel="stylesheet" href="/css/style0.css">
    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-btn-primary {
            border: 0px solid #C9C9C9;
            background-color: #fff;
            color: #555;
        }
        .layui-card-body{
            text-align: center;
        }
        .layui-card-body span{
            line-height: 30px;
        }
    </style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">火警统计分析</div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <div id="main" style="width: 100%;height:320px;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
</body>
<script src="https://cdn.bootcss.com/echarts/4.2.1-rc1/echarts.min.js"></script>
<script src="/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/vue.js"></script>
<script type="text/javascript" src="/js/xadmin.js"></script>
<script>

    layui.use(['laydate','form','layer'],function() {
        var form = layui.form;
        var layer = layui.layer;
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#test1', //指定元素
            value: new Date(1534766888000)
        });
    })



    var ve = new Vue({
        el: '#divvuehtml',//绑定vue渲染范围
        data: {
            menuItems: {},//初始化菜单资源list
        },
        created: function () {//vue在打开html前初始化创建函数
            this.inin();  //初始化菜单效果
        },
        mounted: function () {//初始化html完成后在进行操作

        },
        methods: {//调用函数
            inin :function (){
                $.get("/sys/main/echart",{},function(data){
                    if(data.success){
                        if(data.data!=null){
                            var myChart = echarts.init(document.getElementById('main'));
                            option = {
                                xAxis: {
                                    type: 'category',
                                    boundaryGap: false,
                                    data: data.data.date
                                },
                                yAxis: {
                                    type: 'value'
                                },
                                series: [
                                    {
                                        data: data.data.money,
                                        type: 'line',
                                        areaStyle: {}
                                    }
                                ]
                            };
                            myChart.setOption(option);
                        }
                    }else{
                        layui.use(['layer'], function(){
                            var layer = layui.layer;
                            xadmin.alert(data.msg,{icon:5})
                        })
                    }

                },"json")
            }
        }
    })
</script>

</html>
